#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   create_model.py
@Time    :   2024-07-09 12:52:37
@Author  :   chakcy 
@Email   :   947105045@qq.com
@description   :   创建模型文件
'''

import os

# 逆向工程 自动生成模型文件
if __name__ == '__main__':
    tables = ["user_personal"]
    path = r"mysql+pymysql://root:020709djh@192.168.56.101:3306/hello_world"
    os.system(
        f'sqlacodegen --tables {",".join(tables)} {path} > app/models/user/user_personal.py')
    
    # "sqlacodegen --tables record mysql+pymysql://root:020709@192.168.56.121:3306/newsServer > app/dao/models/db_models.py"